<div class="bg-light lter b-b wrapper-sm">
	<h1 class="m-n font-thin h4">客户资料管理</h1>
</div>
<div class="wrapper-sm" >
	<uib-tabset active="8" class="tab-container" ng-init="steps={percent:20, step1:false, step2:false, step3:false, step4:false, step5:false, step6:false, step7:false, step8:true}">
		<uib-tab heading="基本信息"  select="steps.percent=20" ui-sref="app.client.client_edit">
			<uib-progressbar value="steps.percent" class="progress-xs" type="success"></uib-progressbar>
		</uib-tab>
		<uib-tab heading="客户代表"  select="steps.percent=35" ui-sref="app.client.customerrepresentative_manage"></uib-tab>
		<uib-tab heading="货物分类"  select="steps.percent=45" ui-sref="app.client.goodstype_manage"></uib-tab>
		<uib-tab heading="货物"  select="steps.percent=55" ui-sref="app.client.goods_manage"></uib-tab>
		<uib-tab heading="结算方"  select="steps.percent=65" ui-sref="app.client.settleManagent"></uib-tab>
		<uib-tab heading="线路报价"  select="steps.percent=75" ui-sref="app.client.lineprice_manage"></uib-tab>
		<uib-tab heading="工程"  select="steps.percent=85" ui-sref="app.client.projectManagent"></uib-tab>
		<uib-tab heading="客户资料" index="8" select="steps.percent=100" ui-sref="app.client.clientinfo_manage">
			<form name="step8" id="clientInfoForm" class="form-validation form-horizontal" novalidate ng-controller="clientInfoManagentController" >
				<uib-progressbar value="steps.percent" class="progress-xs" type="success"></uib-progressbar>
				<div class="wrapper-sm ">
					<div class="panel panel-default">
						<div class="panel-heading font-bold">查询</div>
						<div class="panel-body">
							<label class="control-label pull-left m-l m-r">客户单位</label>
							<div class="col-md-6 form-group m-l m-r">
								<label class="control-label pull-left m-l m-r"> {{clientName}}</label>
							</div>
							<div class="line line-xs pull-in"></div>
							<label class="control-label pull-left m-l m-r">资料名称</label>
							<div class="col-md-2 form-group">
								<input id="clientInfo_name" type="text" class="form-control input-sm" ng-model="queryTerms.name" name="name" placeholder="请输入资料名称">
							</div>
							<label class="control-label pull-left m-l m-r">资料类别</label>
							<div class="col-md-2 form-group">
								<select id="clientInfo_clientInfoType" class="form-control input-sm" ng-model="queryTerms.type" name="clientInfoType" ng-options="x.value as x.text for x in typeDropDown">
                                    <option value="">全部</option>
                                </select>
							</div>
							<label class="control-label pull-left m-l m-r">档案级别</label>
							<div class="col-md-2 form-group">
								<select id="clientInfo_clientInfoLevel" class="form-control input-sm" ng-model="queryTerms.level" name="level" ng-options="x.value as x.text for x in levelDropDown">
                                    <option value="">全部</option>
                                </select>
							</div>
							<button id="clientInfo_query" ng-click="queryFunc()" class="btn btn-sm btn-default btn-addon m-l" ng-class="{'disabled':querying}" ng-disabled="querying">
                                <i class="fa fa-search" ng-show="!querying"></i>
                                <i class="fa fa-spinner no-bordr" ng-show="querying" ng-class="{'fa-spin':querying}"></i>
                                <span ng-show="!querying">查询</span>
                                <span ng-show="querying">查询中...</span>
                            </button>
						</div>
					</div>
					<div class="panel panel-default">
						<div class="panel-heading">
							客户资料列表
						</div>
						<div class="table-responsive">
							<div ui-grid="gridOptions" ui-grid-pagination ui-grid-auto-resize ui-grid-resize-columns style=" height:{{heightA}}px; min-height:390px; 
                                 overflow-y:hidden; min-width:1000px;">
								<div class="watermark" ng-if="!gridOptions.data.length">暂无数据</div>
							</div>

						</div>
					</div>
					<button id="clientInfo_add" data-toggle="modal" data-target="#clientinfo" class="pull-right-xs btn m-b-xs btn-sm btn-info btn-addon " ng-click="addClientInfo()"><i class="fa fa-plus"></i>添加</button>
					<!-- Modal -->
					<div class="modal fade bs-example-modal-lg" id="clientinfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
						<div class="modal-dialog modal-lg">
							<div class="modal-content">
								<div class="modal-header">
									<button id="clientInfo_model" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
									<h4 class="modal-title" id="myModalLabel">{{title}}</h4>
								</div>
								<div class="modal-body">
									<div class="form-group">
										<label class="col-lg-3 control-label">资料名称<span class="text-danger">*</span></label>
										<div class="col-lg-4">
											<input id="clientInfo_nameBox" type="text" name="nameBox" class="form-control" ng-model="detail.name" required placeholder="请填写资料名称">
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-3 control-label">资料类别<span class="text-danger">*</span></label>
										<div class="col-lg-3">
											<select id="clientInfo_type" class="form-control" ng-change="handleInfoTypeChange()" name="infoTypeBox" ng-model="detail.type" ng-options="x.value as x.text for x in typeDropDown"
												required>
                                                <option value="">请选择</option>
                                            </select>
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-3 control-label">档案级别<span class="text-danger">*</span></label>
										<div class="col-lg-3">
											<select id="clientInfo_level" class="form-control" name="infoLevelBox" ng-model="detail.level" ng-options="x.value as x.text for x in levelDropDown"
												required>
                                                <option value="">请选择</option>
                                            </select>
										</div>
									</div>
									<div class="form-group">
										<label class="col-lg-3 control-label">资料内容<span class="text-danger">*</span></label>
										<div class="col-lg-8">
											<div class="">
												<div class="btn-toolbar m-b-sm btn-editor" data-role="editor-toolbar" data-target="#editor">
													<!--<div class="btn-group dropdown" dropdown>
														<a class="btn btn-default" dropdown-toggle data-toggle="dropdown"  tooltip="Font"><i class="fa fa-font"></i><b class="caret"></b></a>
														<ul class="dropdown-menu">
															<li><a href data-edit="fontName Serif" style="font-family:'Serif'">Serif</a></li>
															<li><a href data-edit="fontName Sans" style="font-family:'Sans'">Sans</a></li>
															<li><a href data-edit="fontName Arial" style="font-family:'Arial'">Arial</a></li>
														</ul>
													</div>-->
													<div class="btn-group dropdown" dropdown>
														<a class="btn btn-default" dropdown-toggle data-toggle="dropdown" tooltip="字体大小"><i class="fa fa-text-height"></i>&nbsp;<b class="caret"></b></a>
														<ul class="dropdown-menu">
															<li><a href data-edit="fontSize 5" style="font-size:24px">大</a></li>
															<li><a href data-edit="fontSize 3" style="font-size:18px">中</a></li>
															<li><a href data-edit="fontSize 1" style="font-size:14px">小</a></li>
														</ul>
													</div>
													<div class="btn-group">
														<a class="btn btn-default" data-edit="bold" tooltip="粗体 (Ctrl/Cmd+B)"><i class="fa fa-bold"></i></a>
														<a class="btn btn-default" data-edit="italic" tooltip="斜体 (Ctrl/Cmd+I)"><i class="fa fa-italic"></i></a>
														<a class="btn btn-default" data-edit="strikethrough" tooltip="删除线"><i class="fa fa-strikethrough"></i></a>
														<a class="btn btn-default" data-edit="underline" tooltip="下划线 (Ctrl/Cmd+U)"><i class="fa fa-underline"></i></a>
													</div>
													<div class="btn-group">
														<!--<a class="btn btn-default" data-edit="insertunorderedlist" tooltip="项目符号" ><i class="fa fa-list-ul"></i></a>-->
														<a class="btn btn-default" data-edit="insertorderedlist" tooltip="编号"><i class="fa fa-list-ol"></i></a>
														<a class="btn btn-default" data-edit="outdent" tooltip="减少缩进量  (Shift+Tab)"><i class="fa fa-dedent"></i></a>
														<a class="btn btn-default" data-edit="indent" tooltip="缩进 (Tab)"><i class="fa fa-indent"></i></a>
													</div>
													<div class="btn-group">
														<a class="btn btn-default" data-edit="justifyleft" tooltip="左对齐 (Ctrl/Cmd+L)"><i class="fa fa-align-left"></i></a>
														<a class="btn btn-default" data-edit="justifycenter" tooltip="居中 (Ctrl/Cmd+E)"><i class="fa fa-align-center"></i></a>
														<a class="btn btn-default" data-edit="justifyright" tooltip="右对齐 (Ctrl/Cmd+R)"><i class="fa fa-align-right"></i></a>
														<a class="btn btn-default" data-edit="justifyfull" tooltip="两端对齐 (Ctrl/Cmd+J)"><i class="fa fa-align-justify"></i></a>
													</div>
													
													<div class="btn-group">
														<a class="btn btn-default" data-edit="undo" tooltip="撤销 (Ctrl/Cmd+Z)"><i class="fa fa-undo"></i></a>
														<a class="btn btn-default" data-edit="redo" tooltip="重做 (Ctrl/Cmd+Y)"><i class="fa fa-repeat"></i></a>
													</div>
												</div>
												<div ui-jq="wysiwyg" id="content" ng-model="detail.content" name="content" class="form-control insertContent" required style="overflow:scroll;height:200px;max-height:200px"></div>
											</div>
										</div>
									</div>

									<!-- 添加附件 -->
									<hr>
									<div class=" m-l-xs">
											
										<span style="font-size:120%;font-weight:bold" class="pull-left m-l m-r">添加附件</span>
										
										<div style="color:red" class=" form-group">
											可添加Word、Excel、图片、Pdf文件
										</div>
									</div>
									<div class=" m-l-xs">

										<label class="pull-left m-l m-r">附件添加</label>
										
										<div class="col-md-3 form-group">
											<input id="inquiryAdd_attachmentUploader" name="attachmentUploader" type="file" file-read uploader="attachmentUploader" multiple />
										</div>
									</div>
									<div class="wrapper-sm">
										<div class="line  pull-in"></div>
										<div class="wrapper-sm bg-light dk b-b m-b-xs hidden">
											<span class="">上传文件数: <b class="badge bg-info">{{ attachmentUploader.queue.length }}</b></span>
										</div>
										<table class="table bg-white-only b-a" ng-if="attachmentUploader.queue.length">
											<thead>
												<tr>
													<th width="50%">名称</th>
													<th >大小</th>
													<th >进度</th>
													<th>状态</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody>
												<tr ng-repeat="item in attachmentUploader.queue">
													<td>
														<strong>{{ item.fileName }}</strong>
													</td>
													<td  nowrap>{{ item.fileSize/1024/1024|number:2 }} MB</td>
													<td >
														<div class="progress" style="margin-bottom: 0;">
															<div class="progress-bar" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
														</div>
													</td>
													<td class="text-center">
														<span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>
														<span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>
														<span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>
													</td>
													<td nowrap>
														<button id="inquiryAdd_download" class="btn btn-success btn-xs" ng-click="handleItemDownLoader(item)" ng-if="item.imgSrc">
															<span class="glyphicon glyphicon-download"></span> 下载
														</button>
														<button id="inquiryAdd_upload" class="btn btn-success btn-xs" ng-click="handleItemUploader(item)" ng-disabled="item.isReady || item.isUploading || item.isSuccess">
															<span class="glyphicon glyphicon-upload"></span> 上传
														</button>
														<button id="inquiryAdd_onDelete" class="btn btn-danger btn-xs" ng-click="handleItemDelete(item)">
															<span class="glyphicon glyphicon-trash"></span> 删除
														</button>
													</td>
												</tr>
											</tbody>
										</table>
										<button id="inquiryAdd_uploadAll" ng-if="attachmentUploader.queue.length" class="btn btn-sm btn-addon btn-success" ng-click="uploadAllFile()" ng-disabled="!attachmentUploader.getNotUploadedItems().length">
											<i class="fa fa-arrow-circle-o-up"></i> 全部上传
										</button>
									</div>
								</div>
								<div class="modal-footer">
									<button id="clientInfo_dismiss" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
									<button id="clientInfo_save" type="button" class="btn btn-primary" ng-click="detail.click()">保存</button>
								</div>
							</div>
						</div>
					</div>
				</div>
			</form>
		</uib-tab>

		<uib-tab heading="对账回款周期"  select="steps.percent=100" ui-sref="app.client.returnPeriod"></uib-tab>
	</uib-tabset>
</div>